//通过vue-router插件实现路由器配置
import { createRouter, createWebHashHistory } from 'vue-router'
//引入路由
import { constantRoute } from './routes'
//创建路由器
const router = createRouter({
  //路由模式hash
  history: createWebHashHistory(),
  // 注册常量路由
  routes: constantRoute,
  //滚动行为 -- 切换路由时, 滚动到左上角
  scrollBehavior() {
    return {
      left: 0,
      top: 0,
    }
  },
})
export default router
